<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    .box {
      margin: 20px auto;
      width: 200px;
      height: 200px;
      border: 2px solid skyblue;
    }
    .box1 {
      background: linear-gradient(#fff 0%, #fff 50%, #f00 50%, #f00 100%);
    }
    .box2 {
      background: linear-gradient(
        45deg,
        #f00 0%,
        #f00 50%,
        transparent 50%,
        transparent 100%
      );
    }
  </style>
  <body>
    <div class="box box1">box1</div>
    <div class="box box2">box2</div>
  </body>
</html>
